package com.vf.cloud.paas.app.master.api.file.service.impl;

import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.vf.cloud.paas.app.master.api.file.service.IModelFile;
import com.vf.cloud.paas.app.master.common.repository.IModelFileRepository;
import com.vf.cloud.paas.app.master.common.repository.base.ModelFile;

@Service
public class ModelFileImpl implements IModelFile {

	@Autowired
	private IModelFileRepository modelFileRepository;

	@Override
	public ModelFile save(ModelFile entity) {
		return modelFileRepository.save(entity);
	}

	@Override
	public void deleteById(String id) {
		modelFileRepository.deleteById(id);
	}

	@Override
	public ModelFile findById(String id) {
		Optional<ModelFile> optional = modelFileRepository.findById(id);
		if (optional.isPresent())
			return optional.get();
		return null;
	}

}
